package org.jeik.listeners;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

import org.jeik.beackBeans.contents.PageContentsBean;
import org.jeik.common.Constants;
import org.jeik.utils.Configs;
import org.jeik.utils.Log;
import org.jeik.utils.WebUtils;

/**
 * Application Lifecycle Listener implementation class JEIKAppServletContextListener
 * @author AAsha
 *
 */
@WebListener
public class JEIKAppServletContextListener implements ServletContextListener {

	/**
     * @see ServletContextListener#contextInitialized(ServletContextEvent)
     */
    public void contextInitialized(ServletContextEvent arg0) {
    	PageContentsBean pageContentsBean = (PageContentsBean) WebUtils.resolveExpression(WebUtils.PAGE_CONTENTS_BEAN, PageContentsBean.class);
    	pageContentsBean.refreshCache();
    	
    }
	/**
     * @see ServletContextListener#contextDestroyed(ServletContextEvent)
     */
    public void contextDestroyed(ServletContextEvent arg0) {
    }
	
}
